<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>

<%@ taglib prefix="s" uri="/struts-tags"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
	<head>

		<link href="css/site.css" rel="stylesheet" type="text/css" />
		<title>流媒体视频管理系统-历史上传</title>
		<SCRIPT type="text/javascript" src="js/WdatePicker.js"></SCRIPT>
		<SCRIPT type="text/javascript" src="js/jquery-1.5.1.min.js"></SCRIPT>
		<SCRIPT type="text/javascript">
			function deletevideo(id)
			{
				var params = {"id":id};
				$.ajax( {
					url : "DeleteVideo.action",
					data : params,
					type : "POST",
					dataType : "json",
					success : function(data) {
						if (data=='true') {
							alert('删除成功');
							$("#tt_"+id).remove();
						} else {
							alert('删除失败');
						}
					},
					error : function(ee) {
						alert('error');
					}
				});
				}
		</SCRIPT>
	</head>

	<body class="mainTopBg">
		<table
			style="height: 93px; text-align: center; margin: auto; width: 100%;">
			<tr>
				<td>
					<jsp:include page="top.jsp" flush="true"></jsp:include>

					<div class="mainHolder">
						<div
							style="text-align: left; width: 900px; font-size: 20px; padding-top: 15px; padding-left: 30px;">
							<div style="float: left">
								当前位置:信息检索->历史上传
							</div>
							<jsp:include page="searchBar.jsp"></jsp:include>
						</div>
						<hr />
						<form action="searchHistory" theme="simple">
							<div>
								视频名称：
								<input type="text" name="name"
									value="" />
								上传时间：
								<input type="text" name="uploadTimeBegin"
									value=""
									onClick="WdatePicker();" />
								至:
								<input type="text"
									value=""
									name="uploadTimeEnd" onClick=WdatePicker();; />
								<input type="submit" value="查询" class="button">
							</div>
						</form>
						<s:set name="historyList" value="#request.historyList" />
						<table id="mytable" style="width: 95%">
							<tr>
								<th>
									操作
								</th>
								<th>
									视频名称
								</th>
								<th>
									视频分类
								</th>
								<th>
									视频状态
								</th>
								<th>
									上传时间
								</th>
							</tr>
							<s:if test="#historyList==null||#historyList.size()==0">
								<tr height="30">
									<td colspan=5 align="center" style="border: 1 solid">
										暂无上传视频
									</td>
								</tr>
							</s:if>
							<s:else>
								<s:iterator status="payforStatus" value="historyList">
									<tr height="23" id="tt_<s:property value="id" />">
										<%--如果当前行的状态为奇数，则添加TR标签
									<s:if test="#payforStatus.odd">
										
									</s:if>--%>

										<td>
											<a onclick="deletevideo('<s:property value="id" />')">删除</a>

										</td>
										<td>
											<a target="_blank" href="PlayVideo.action?id=<s:property value="id" />">
												<s:property value="name" /> </a>
										</td>
										<td>
											<s:property value="getCategoryName()" />
										</td>
										<td>
											<s:property value="getStatuString()" />
										</td>
										<td>
											<s:property value="getMyUploadTime()" />
										</td>
									</tr>
									<%--如果当前行的状态为偶数，则添加TR标签进行换行 
									<s:if test="#payforStatus.even">
										
									</s:if>--%>
								</s:iterator>
							</s:else>
						</table>
					</div>
				</td>
			</tr>
		</table>
		<s:actionerror />
	</body>
</html>
